/**
 * 
 */
package com.nervytech.tutorcruise.db.dao.mysql.impl;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;

import com.nervytech.tutorcruise.db.dao.interfaces.ICourseRequestsLocationDAO;
import com.nervytech.tutorcruise.db.dao.model.CourseRequestsLocation;

/**
 * @author ADMIN
 * 
 */
@Repository("courseRequestsLocationDAO")
public class CourseRequestsLocationDAO extends JdbcDaoSupport implements
		ICourseRequestsLocationDAO {

	@Autowired
	CourseRequestsLocationDAO(DataSource dataSource) {
		setDataSource(dataSource);
	}

	@Override
	public void saveLocation(CourseRequestsLocation reqLoc) {

		String saveUserQuery = "insert into course_requests_location(request_id,city,zip_code,address,created_time,updated_time) "
				+ " values(?,?,?,?,?,?)";

		Object[] parms = { reqLoc.getRequestId(), reqLoc.getCity(),
				reqLoc.getZipCode(), reqLoc.getAddress(),
				reqLoc.getCreatedTime(), reqLoc.getUpdatedTime() };

		getJdbcTemplate().update(saveUserQuery, parms);

	}

}
